import { JSX } from 'react';

export type PdfNodeProps = {
  id?: string;
  type?: string;
  position?: { x: number; y: number };
  selected?: boolean;
  width: number;
  height: number;
  data?: {
    label: string;
    value?: string;
    style?: React.CSSProperties;
    dataBinding?: string; // 绑定字段
    // 特殊类型字段
    src?: string; // 图片地址
    tableColumns?: Array<{ key: string; label: string }>; // 表格列
  } & Record<string, unknown>;
};
export type PdfNodeFunc = {
  ({ data, selected }: PdfNodeProps): JSX.Element;
  displayName: string;
  defaultProps: PdfNodeProps;
};

export interface PdfUnit {
  pxPerPt: number;
  pxPerMm: number;
}
export interface PdfTemplate {
  unit: PdfUnit;
  nodes: PdfNodeProps[];
}
